Memory device for swapping data and operating method thereof

ABSTRACT

An operating method of a memory device, which includes a first memory region and a second memory region, includes reading first data from the first memory region and storing the read first data in a data buffer block, performing a first XOR operation on the first data provided from the data buffer block and second data read from the second memory region to generate first result data, writing the first data stored in the data buffer block in the second memory region, performing a second XOR operation on the first data and the first result data to generate the second data, storing the generated second data in the data buffer block, and writing the second data stored in the data buffer block in the first memory region.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application claims priority under 35 U.S.C. § 119 to Korean PatentApplication No. 10-2019-0040123 filed on Apr. 5, 2019, in the KoreanIntellectual Property Office, the disclosure of which is incorporated byreference herein in its entirety.

BACKGROUND

Embodiments of the disclosure described herein relate to a semiconductordevice, and more particularly, relate to a memory device for swappingdata stored in different memory regions and an operating method thereof.

Semiconductor memory devices are classified into a volatile memorydevice in which stored data disappear when power is turned off and anonvolatile memory device in which stored data are retained even whenpower is turned off.

A memory device may swap data stored in different memory regions for thepurpose of bad-block management, wear-leveling, etc. To swap data, datastored in the memory device may be transferred to a memory controllerand the data transferred to the memory controller may be againtransferred to the memory device. In this case, data communicationbetween the memory device and the memory controller may cause anincrease in overhead. Also, the memory controller may require a separateswap buffer for the data swap and the data communication between thememory device and the memory controller may cause a decrease in a swapspeed.

SUMMARY

Embodiments of the disclosure provide a memory device capable ofswapping data within the memory device without using a memory controllerand an operating method thereof.

According to an exemplary embodiment, an operating method of a memorydevice, which includes a first memory region and a second memory region,includes reading first data from the first memory region and storing theread first data in a data buffer block, performing a first XOR operationon the first data provided from the data buffer block and second dataread from the second memory region to generate first result data,writing the first data stored in the data buffer block in the secondmemory region, performing a second XOR operation on the first data andthe first result data to generate the second data, storing the generatedsecond data in the data buffer block, and writing the second data storedin the data buffer block in the first memory region.

According to an exemplary embodiment, a memory device includes a memorycell array that includes a first memory region storing first data and asecond memory region storing second data, a read circuit that reads thefirst data from the first memory region, data generation logic thatgenerates third data identical to the second data based on the seconddata from the second memory region, a selection circuit that outputs oneof the first data from the read circuit and the third data from the datageneration logic based on a control signal, a data buffer block thatstores the first data or the third data output from the selectioncircuit, and a write circuit that writes the first data of the databuffer block in the second memory region and writes the third data ofthe data buffer block in the first memory region.

According to an exemplary embodiment, an operating method of a memorydevice, which includes a first memory region and a second memory region,includes reading first data from the first memory region and storing theread first data in a data buffer, reading second data from the secondmemory region and storing the read second data in a swap buffer, writingthe first data stored in the data buffer in the second memory region,and writing the second data stored in the swap buffer in the firstmemory region.

According to an exemplary embodiment, a memory device may include amemory cell array that includes a first memory cell area and a secondmemory cell area, a data buffer block that stores first data from thefirst memory region, a data comparison write circuit that performs afirst XOR operation on the first data from the data buffer block and thesecond data from the second memory region and outputs first result data,a write circuit that writes the first data from the data buffer block inthe second memory region, a read circuit that reads the first datastored in the first memory region or the second memory region, an XORgate that performs a second XOR operation on the first result data ofthe data comparison write circuit and the first data from the readcircuit and generates the second data, and a selection circuit thatoutputs one of the second data from the XOR gate and an output of theread circuit. The second data from the selection circuit are stored inthe data buffer block, and the write circuit writes the second data fromthe data buffer block in the first memory region.

According to an exemplary embodiment, an operating method of a memorydevice which includes a first memory region and a second memory regionmay include reading first data from the first memory region of a firstbank, storing the read first data in a first data buffer correspondingto the first bank, reading second data from the second memory region ofa second bank and storing the read second data in a second data buffercorresponding to the second bank, writing the second data stored in thesecond data buffer in the first memory region, and writing the firstdata stored in the first data buffer in the second memory region.

According to an exemplary embodiment, an operating method of a memorydevice having a memory cell array, a row decoder, a control circuit, aread circuit, a write circuit, a first buffer and a second buffer may beexecutable by the control circuit. The method includes operations of: 1)controlling the read circuit to read first data from a first location ofthe memory cell array identified by a first address; 2) controlling thefirst buffer to store the first data that is read in operation (1) or anerror-corrected version of the first data; 3) controlling the writecircuit to write the first data or the error-corrected version of thefirst data, which is stored in the first buffer, into a second locationof the memory cell array identified by a second address; 4) controllingthe second buffer to store second data written at the second location ofthe memory cell array or an error-corrected version of the second data;and 5) controlling the write circuit to write the second data or theerror-corrected version of the second data, which is stored in thesecond buffer, into the first location of the memory cell arrayidentified by the first address. Operations (1) through (5) areperformed in response to the control circuit receiving one or morecommands from a memory controller that is disposed externally to thememory device.

BRIEF DESCRIPTION OF THE FIGURES

The above and other objects and features of the disclosure will becomeapparent by describing in detail exemplary embodiments thereof withreference to the accompanying drawings.

FIG. 1 illustrates a memory system according to an exemplary embodimentof the disclosure.

FIG. 2 illustrates an exemplary block diagram of a memory device of FIG.1 for swapping data within the memory device.

FIG. 3 is a flowchart illustrating an example of an operation of amemory device of FIG. 2.

FIG. 4 illustrates an example of an operation in which a memory deviceof FIG. 2 swaps data stored in one bank.

FIG. 5 illustrates an example of an operation in which a memory deviceof FIG. 2 swaps data stored in different banks.

FIG. 6 illustrates another exemplary block diagram of a memory device ofFIG. 1 for swapping data within the memory device.

FIG. 7 illustrates another exemplary block diagram of a memory device ofFIG. 1 for swapping data within the memory device.

FIG. 8 is a flowchart illustrating an example of an operation of amemory device of FIG. 7.

FIG. 9 illustrates an example of a command and an address provided to amemory device of FIG. 7 for a data swap.

FIGS. 10A to 10D illustrate an example of an operation in which a memorydevice of FIG. 7 swaps data based on a command and an address of FIG. 9.

FIG. 11 illustrates another example of an operation in which a memorydevice of FIG. 7 swaps data based on a command and an address of FIG. 9.

FIG. 12 illustrates an example of a command and an address provided to amemory device of FIG. 7 for a swap of data stored in different banks.

FIG. 13 illustrates an example of an operation in which a memory deviceof FIG. 7 swaps data based on a command and an address of FIG. 12.

FIG. 14 illustrates a block diagram of a memory system according to anexemplary embodiment of the disclosure.

FIG. 15 illustrates a block diagram of a memory system according to anexemplary embodiment of the disclosure.

FIG. 16 is a block diagram of a computing device according to anexemplary embodiment of the disclosure.

DETAILED DESCRIPTION

Below, embodiments of the disclosure may be described in detail andclearly to such an extent that an ordinary one in the art easilyimplements the disclosure.

FIG. 1 illustrates a memory system according to an exemplary embodimentof the disclosure. Referring to FIG. 1, a memory system 1000 may includea memory controller 10 and a memory device 100.

The memory controller 10 may control an operation of the memory device100. The memory controller 10 may provide a command CMD and an addressADDR for the purpose of controlling the memory device 100. The memorydevice 100 may operate in response to the command CMD and the addressADDR. For example, the memory device 100 may write data (e.g., writedata) in a memory region corresponding to the address ADDR in responseto a write command WC and the address ADDR. For example, the memorydevice 100 may read data (e.g., read data) from the memory regioncorresponding to the address ADDR in response to a read command RC andthe address ADDR.

The memory device 100 includes a memory cell array 110. The memory cellarray 110 may include one or more banks. Each of the banks may includememory regions for storing data. Each of the memory regions may includea plurality of memory cells.

For example, the memory cell array 110 may include a first memory regionMA1 and a second memory region MA2. The first memory region MA1 and thesecond memory region MA2 may be included in one bank or different banks.The first memory region MA1 may store first data DATA1, and the secondmemory region MA2 may store second data DATA2.

The memory device 100 may include a phase-change memory random accessmemory (PRAM). However, the disclosure is not limited thereto. Forexample, the memory device 100 may include a volatile memory, such as astatic RAM (SRAM), a dynamic RAM (DRAM), or a synchronous DRAM (SDRAM),or a nonvolatile memory, such as a read only memory (ROM), aprogrammable ROM (PROM), an electrically programmable ROM (EPROM), anelectrically erasable and programmable ROM (EEPROM), a flash memory, amagnetic RAM (MRAM), a resistive RAM (RRAM), or a ferroelectric RAM(FRAM).

According to an exemplary embodiment of the disclosure, the memorycontroller 10 may provide the command CMD and the address ADDR to thememory device 100 for the purpose of swapping data stored in differentmemory regions of the memory device 100.

For example, for a data swap, the memory controller 10 may provide oneswap command SWAP and two addresses ADDR1 and ADDR2. The first addressADDR1 may correspond to the first memory region MA1, and the secondaddress ADDR2 may correspond to the second memory region MA2. In thiscase, the memory device 100 may swap the first data DATA1 stored in thefirst memory region MA1 with the second data DATA2 stored in the secondmemory region MA2 in response to the swap command SWAP. As such, thesecond data DATA2 may be stored in the first memory region MA1, and thefirst data DATA1 may be stored in the second memory region MA2.

Alternatively, for the data swap, the memory controller 10 may provide aplurality of commands CMD and a plurality of addresses ADDR. Theplurality of commands CMD may include an active command ACT and thewrite command WC. That is, the memory controller 10 may swap the firstdata DATA1 stored in the first memory region MA1 with the second dataDATA2 stored in the second memory region MA2 without using the separateswap command SWAP.

As described above, the memory device 100 may receive the command CMDand the address ADDR from the memory controller 10 and may swap data.That is, the memory device 100 may swap data therein withouttransferring data stored in the memory cell array 110 to the memorycontroller 10. Accordingly, a data swap speed may be improved, and thecommunication overhead between the memory device 100 and the memorycontroller 10 due to the data swap may decrease.

FIG. 2 illustrates an exemplary block diagram of a memory device of FIG.1 for swapping data within the memory device. Referring to FIG. 2, amemory device 200 may include a memory cell array 210, a row decoder220, a read circuit 230, a write circuit 240, a data buffer block 250, aswap buffer block 260, and control logic 270.

The memory cell array 210 may include one or more banks, each of whichincludes memory regions for storing data. Each of the memory regions mayinclude memory cells connected to word lines WL and bit lines BL. Forexample, memory cells in each row may be connected to one word-line WL.Memory cells in each column may be connected to one bit-line BL.However, the disclosure is not limited thereto. For example, memorycells in each column may be connected to one source line as well as onebit-line BL.

The row decoder 220 is connected to the memory cell array 210 throughthe word lines WL. The row decoder 220 may receive the address ADDR. Inthis case, the address ADDR may indicate a row address. The row decoder220 may select one of the word lines WL based on the address ADDR. Therow decoder 220 may apply a selection voltage or a selection current tothe selected word line and may apply a non-selection voltage or anon-selection current to each of unselected word lines.

The read circuit 230 is connected to the memory cell array 210 throughthe bit lines BL. The read circuit 230 may apply voltages or currents tothe bit lines BL such that data are read from the selected memory cellsconnected to the selected word line WL, and the write circuit 240 mayapply voltages or currents to the bit lines BL such that data arewritten in the selected memory cells connected to the selected word lineWL.

For example, in the case where the memory cell array 210 includes PRAMcells, the read circuit 230 may sense voltages or currents of the bitlines BL to read data from the selected memory cells. The write circuit240 may perform a set operation or a reset operation on the selectedmemory cells to change resistance values of the selected memory cells.As such, data may be written in the selected memory cells. In anexemplary embodiment, the read circuit 230 may be a sense amplifier, andthe write circuit 240 may be a write driver. However, the disclosure isnot limited thereto. For example, the read circuit 230 may beimplemented with various circuits capable of reading data from thememory cell array 210, and the write circuit 240 may be implemented withvarious circuits capable of writing data in the memory cell array 210.

The data buffer block 250 may store data read from the memory cell array210 through the read circuit 230 and data provided from an externaldevice (e.g., the memory controller 10 of FIG. 1). The data stored inthe data buffer block 250 may be outputted to the external device or bewritten to the memory cell array 210 through the write circuit 240. Forexample, the data buffer block 250 may be a page buffer. However, thedisclosure is not limited thereto.

The data buffer block 250 may include one or more data buffers. Forexample, the data buffer block 250 may include a data buffercorresponding to each of banks of the memory cell array 210. In thiscase, data transfer may be performed between the data buffer and thecorresponding bank among the banks of the memory cell array 210.

The swap buffer block 260 may include one or more swap buffers. Forexample, the swap buffer block 260 may include a swap buffercorresponding to each of the banks of the memory cell array 210. In thiscase, the swap buffer may be used to swap data of the memory cell array210.

The data transfer may be performed between the swap buffer block 260 andthe memory cell array 210 through the read circuit 230 and the writecircuit 240. In an exemplary embodiment, the swap buffer block 260 maystore data read from a certain region of the memory cell array 210. Inthis case, the data stored in the swap buffer block 260 may be providedto a region of the memory cell array 210, which is different from thecertain region.

That is, the data buffer block 250 may be used to provide data inputfrom the external device to the memory cell array 210 or to output dataread from the memory cell array 210 to the external device. In contrast,the swap buffer block 260 may be used to swap data stored in the memorycell array 210.

The control logic 270 may control an operation of each component of thememory device 200. For example, the control logic 270 may controloperations of the row decoder 220, the read circuit 230, the writecircuit 240, the data buffer block 250, and the swap buffer block 260.The control logic 270 may control an operation of each component basedon the received command CMD. For example, when the command CMD for swapis provided, the control logic 270 may control the components to swapdata of the memory cell array 210.

Below, an operation in which the memory device 200 swaps data will bedescribed in detail with reference to FIGS. 3 to 5.

FIG. 3 is a flowchart illustrating an example of an operation of amemory device of FIG. 2. In detail, FIG. 3 illustrates an example of anoperation in which the memory device 200 swaps first data stored in afirst memory region of the memory cell array 210 with second data storedin a second memory region thereof.

Referring to FIGS. 2 and 3, in operation S201, the memory device 200 mayread the first data from the first memory region through the readcircuit 230 and may store the first data in a data buffer. Here, thedata buffer may be included in the data buffer block 250.

In operation S202, the memory device 200 may read the second data fromthe second memory region through the read circuit 230 and may store thesecond data in a swap buffer. Here, the swap buffer may be included inthe swap buffer block 260.

In operation S203, the memory device 200 may write the first data storedin the data buffer in the second memory region through the write circuit240. As such, the second data stored in the second memory region may bereplaced with the first data.

In operation S204, the memory device 200 may write the second datastored in the swap buffer in the first memory region through the writecircuit 240. As such, the first data stored in the first memory regionmay be replaced with the second data.

As described above, the memory device 200 may perform the operations ofFIG. 3 in response to one swap command SWAP or a plurality of commandssuch as the active command ACT and the write command WC.

The description is given in FIG. 3 that operation S202 is performedafter operation S201, but the disclosure is not limited thereto. Forexample, operation S202 may be performed before operation S201. Also,the description is given in FIG. 3 that operation S204 is performedafter operation S203, but the disclosure is not limited thereto. Forexample, operation S204 may be performed before operation S203.

FIG. 4 illustrates an example of an operation in which a memory deviceof FIG. 2 swaps data stored in one bank. Referring to FIG. 4, the memorycell array 210 may include a first bank 211. The first bank 211 mayinclude the first memory region MA1 and the second memory region MA2.The first memory region MA1 may store the first data DATA1, and thesecond memory region MA2 may store the second data DATA2.

The data buffer block 250 may include a first data buffer 251. The firstdata buffer 251 may correspond to the first bank 211. The swap bufferblock 260 may include a first swap buffer 261. The first swap buffer 261may correspond to the first bank 211.

To swap the first data DATA1 stored in the first memory region MA1 withthe second data DATA2 stored in the second memory region MA2, the firstdata DATA1 of the first memory region MA1 may be read through the readcircuit 230. The first data DATA1 thus read may be stored in the firstdata buffer 251 ({circle around (1)}). The second data DATA2 of thesecond memory region MA2 may be read through the read circuit 230. Thesecond data DATA2 thus read may be stored in the first swap buffer 261({circle around (2)}).

Afterwards, the first data DATA1 stored in the first data buffer 251 maybe written in the second memory region MA2 through the write circuit 240({circle around (3)}). As such, the second data DATA2 stored in thesecond memory region MA2 may be replaced with the first data DATA1. Thesecond data DATA2 stored in the first swap buffer 261 may be written inthe first memory region MA1 through the write circuit 240 ({circlearound (4)}). As such, the first data DATA1 stored in the first memoryregion MA1 may be replaced with the second data DATA2.

FIG. 5 illustrates an example of an operation in which a memory deviceof FIG. 2 swaps data stored in different banks. Referring to FIG. 5, thememory cell array 210 may include the first bank 211 and a second bank212. The first bank 211 may include the first memory region MA1. Thesecond bank 212 may include the second memory region MA2. The firstmemory region MA1 may store the first data DATA1, and the second memoryregion MA2 may store the second data DATA2.

The data buffer block 250 may include the first data buffer 251 and asecond data buffer 252. The first data buffer 251 may correspond to thefirst bank 211, and the second data buffer 252 may correspond to thesecond bank 212. The swap buffer block 260 may include the first swapbuffer 261 and a second swap buffer 262. The first swap buffer 261 maycorrespond to the first bank 211, and the second swap buffer 262 maycorrespond to the second bank 212.

To swap the first data DATA1 stored in the first memory region MA1 withthe second data DATA2 stored in the second memory region MA2, the firstdata DATA1 of the first memory region MA1 may be read through the readcircuit 230. The first data DATA1 thus read may be stored in the databuffer block 250 ({circle around (1)}). In this case, the first dataDATA1 may be stored in the first data buffer 251 corresponding to thefirst bank 211. The second data DATA2 of the second memory region MA2may be read through the read circuit 230. The second data DATA2 thusread may be stored in the swap buffer block 260 ({circle around (2)}).In this case, the second data DATA2 may be stored in the second swapbuffer 262 corresponding to the second bank 212.

Afterwards, the first data DATA1 stored in the first data buffer 251 maybe written in the second memory region MA2 through the write circuit 240({circle around (3)}). As such, the second data DATA2 stored in thesecond memory region MA2 may be replaced with the first data DATA1. Inthis case, the first data DATA1 stored in the first data buffer 251 maybe transferred to the second data buffer 252, and the first data DATA1may be provided to the write circuit 240 from the second data buffer252.

The second data DATA2 stored in the second swap buffer 262 may bewritten in the first memory region MA1 through the write circuit 240({circle around (4)}). As such, the first data DATA1 stored in the firstmemory region MA1 may be replaced with the second data DATA2. In thiscase, the second data DATA2 stored in the second swap buffer 262 may betransferred to the first swap buffer 261, and the second data DATA2 maybe provided to the write circuit 240 from the first swap buffer 261.

As described above, the memory device 200 according to an exemplaryembodiment of the disclosure may swap data stored in one bank or twobanks by using a data buffer and a separate swap buffer. As such, thememory device 200 may swap data without using an external memorycontroller. Accordingly, a data swap may be quickly performed, and thecommunication overhead between the memory device 200 and the memorycontroller 10 may decrease.

FIG. 6 illustrates another exemplary block diagram of a memory device ofFIG. 1 for swapping data within the memory device. Referring to FIG. 6,a memory device 300 may include a memory cell array 310, a row decoder320, a read circuit 330, a write circuit 340, a data buffer block 350, adata comparison write (DCW) circuit 360, and control logic 370.Operations of the memory cell array 310, the row decoder 320, the readcircuit 330, the write circuit 340, the data buffer block 350, and thecontrol logic 370 are similar to the operations of the memory cell array210, the row decoder 220, the read circuit 230, the write circuit 240,the data buffer block 250, and the control logic 270 of FIG. 2, andthus, additional description will be omitted to avoid redundancy.

The data comparison write circuit 360 may include a DCW register 361.The DCW register 361 may be a buffer circuit storing data. The datacomparison write circuit 360 may be used for a data write operation or adata swap operation.

In response to the write command WC, the data comparison write circuit360 may compare data transferred to the data buffer block 350 and dataread from the memory cell array 310. In detail, the data comparisonwrite circuit 360 may compare data in the unit of a bit through anexclusive OR (XOR) operation. For example, in a write operation, newwrite data and the address ADDR where the new write data are to bestored may be provided to the memory device 300. The new write data maybe stored in the data buffer block 350. The data comparison writecircuit 360 may compare the new write data of the data buffer block 350with data of a memory region, which corresponds to the address ADDR, ofthe memory cell array 310. When a comparison result indicates that thetwo data are the same, the data of the memory region may be maintained.When the comparison result indicates that the two data are different,the data of the memory region may be replaced with the new write data.In this case, at least one of the new write data of the data bufferblock 350, the data read from the memory region, and the comparisonresult (e.g., data obtained by performing the XOR operation on the newwrite data and the data read from the memory region) may be stored inthe DCW register 361. That is, when the comparison result indicates thatthe two data are different, the new write data may be written in thememory region of the memory cell array 310 through the write circuit340. Accordingly, the memory device 300 may perform the write operationwith low power through the data comparison write circuit 360.

When the swap command SWAP is provided to swap the first data and thesecond data stored in the memory cell array 310, the first data may bestored in the data buffer block 350 through the read circuit 330 and thesecond data may be stored in the DCW register 361 of the data comparisonwrite circuit 360 through the read circuit 330. The write circuit 340may replace the second data of the memory cell array 310 with the firstdata stored in the data buffer block 350 and may replace the first dataof the memory cell array 310 with the second data stored in the DCWregister 361. As such, data stored in different memory regions may beswapped. That is, in the swap operation, the operation of the DCWregister 361 may be similar to the operation of the swap buffer block260 of FIG. 2.

As described above, the memory device 300 may swap data by using the DCWregister 361 of the data comparison write circuit 360 without theseparate swap buffer block 260 of FIG. 2. In this case, the DCW register361 may be used as a buffer circuit that stores data to be swapped inthe swap operation or may be used as a buffer circuit that stores atleast one of new write data, data read from a memory region where thenew write data are to be written, and XOR data being a comparison resultof the new write data and the read data in the write operation.

The description is given in FIG. 6 that the DCW register 361 is includedin the data comparison write circuit 360 and data of the memory cellarray 310 are stored in the DCW register 361, but the disclosure is notlimited thereto. For example, for the data swap, data of the memory cellarray 310 may be stored in any circuit that is present within the datacomparison write circuit 360 and provides a buffering function.

As described above, the memory device 300 may swap data by using theexisting data comparison write circuit 360 that is provided for anefficient write operation. In this case, because a separate swap bufferis not required, the area of the memory device 300 may not increase.

FIG. 7 illustrates another exemplary block diagram of a memory device ofFIG. 1 for swapping data within the memory device. Referring to FIG. 7,a memory device 400 may include a memory cell array 410, a row decoder420, a read circuit 430, a write circuit 440, a data comparison writecircuit 450, an XOR gate 460, a selection circuit 470, a data bufferblock 480, and control logic 490. Operations of the memory cell array410, the row decoder 420, the read circuit 430, the write circuit 440,the data buffer block 480, and the control logic 490 are similar to theoperations of the memory cell array 210, the row decoder 220, the readcircuit 230, the write circuit 240, the data buffer block 250, and thecontrol logic 270 of FIG. 2, and thus, additional description will beomitted to avoid redundancy.

The data comparison write circuit 450 may receive data read from thememory cell array 410 through the read circuit 430. The data comparisonwrite circuit 450 may receive data from the data buffer block 480. Thedata comparison write circuit 450 may compare data stored in the memorycell array 410 and data stored in the data buffer block 480. In detail,the data comparison write circuit 450 may compare data in the unit of abit. For example, the data comparison write circuit 450 may perform theXOR operation to compare data. The data comparison write circuit 450 mayprovide an enable signal EN to the write circuit 440 based on acomparison result. For example, the data comparison write circuit 450may perform the XOR operation and may output a result of the XORoperation as the enable signal EN.

The result of the XOR operation may be stored in the data comparisonwrite circuit 450. For example, the result of the XOR operation may bestored in a separate register such as the DCW register 361 of FIG. 6,but the disclosure is not limited thereto.

The write circuit 440 may perform the write operation based on theenable signal EN. When the data stored in the memory cell array 410 andthe data stored in the data buffer block 480 are the same, the writecircuit 440 may not operate based on the enable signal EN. In this case,the data of the memory cell array 410 may be maintained. When the datastored in the memory cell array 410 and the data stored in the databuffer block 480 are different, the write circuit 440 may operate basedon the enable signal EN. In this case, the data of the memory cell array410 may be replaced with the data of the data buffer block 480. As such,the data of the data buffer block 480 may be written in the memory cellarray 410 with low power based on the comparison result of the datacomparison write circuit 450. However, the disclosure is not limitedthereto. For example, the write circuit 440 may operate regardless ofthe comparison result of the data comparison write circuit 450 such thatthe data of the data buffer block 480 are written in the memory cellarray 410.

The XOR gate 460 may perform an XOR operation on data output from thedata comparison write circuit 450 and data output from the read circuit430. A result of the XOR operation output from the XOR gate 460 may beprovided to the selection circuit 470.

The selection circuit 470 may output one of data output from the XORgate 460 and the data output from the read circuit 430 to the databuffer block 480. The selection circuit 470 may select data to be outputto the data buffer block 480 based on a control signal from the controllogic 490.

The data buffer block 480 may store data output from the selectioncircuit 470. Also, the data buffer block 480 may store data providedfrom an external device. The data stored in the data buffer block 480may be written in the memory cell array 410 through the write circuit440. In this case, the data stored in the data buffer block 480 may bewritten in the memory cell array 410 based on the enable signal EN.

The control logic 490 may control operations of the components of thememory device 400. In detail, the control logic 490 may control the rowdecoder 420, the read circuit 430, the write circuit 440, the datacomparison write circuit 450, the XOR gate 460, the selection circuit470, and the data buffer block 480. For example, when the command CMDfor data swap is provided, the control logic 490 may control thecomponents to swap data.

An example is illustrated in FIG. 7 that the XOR gate 460 receives thedata output from the data comparison write circuit 450 and the dataoutput from the read circuit 430, but the disclosure is not limitedthereto. For example, the XOR gate 460 may receive the data stored inthe data buffer block 480 instead of the data output from the readcircuit 430. The XOR gate 460 may perform an XOR operation on the dataoutput from the data comparison write circuit 450 and the data outputfrom the data buffer block 480.

Below, an operation in which the memory device 400 swaps data will bedescribed in detail with reference to FIGS. 8 to 12.

FIG. 8 is a flowchart illustrating an example of an operation of amemory device of FIG. 7. In detail, FIG. 8 illustrates an example of anoperation in which the memory device 400 swaps first data stored in afirst memory region of the memory cell array 410 with second data storedin a second memory region thereof.

Referring to FIGS. 7 and 8, in operation S401, the memory device 400 mayread the first data from the first memory region and may store the firstdata in a data buffer. The data buffer may be included in the databuffer block 480. In this case, the control logic 490 may control theselection circuit 470 such that data output from the read circuit 430are selected. As such, the first data may be selected by the selectioncircuit 470 and may then be stored in the data buffer block 480.

In operation S402, the memory device 400 may perform an XOR operation onthe first data provided from the data buffer and the second data readfrom the second memory region and may store a result of the XORoperation. The memory device 400 may perform an XOR operation throughthe data comparison write circuit 450 and may store a result of the XORoperation.

In operation S403, the memory device 400 may write the first data storedin the data buffer in the second memory region. For example, the writecircuit 440 may write the first data based on the result (i.e., theenable signal EN) of the XOR operation output from the data comparisonwrite circuit 450.

In operation S404, the memory device 400 may perform an XOR operation onthe first data and the result of the XOR operation through the XOR gate460 and may generate the second data. Here, the first data may be readfrom the first memory region or the second memory region through theread circuit 430. Alternatively, the first data may be read from thedata buffer of the data buffer block 480. A result of the XOR operationthat is performed on the result of the XOR operation output from thedata comparison write circuit 450 and the first data may be identical tothe second data. As such, the second data may be generated through theXOR gate 460.

In operation S405, the memory device 400 may store the generated seconddata in the data buffer. In this case, the control logic 490 may controlthe selection circuit 470 such that data output from the XOR gate 460are selected. The selection circuit 470 may output the data output fromthe XOR gate 460 to the data buffer block 480. As such, the second datamay be stored in the data buffer.

In operation S406, the memory device 400 may write the second datastored in the data buffer in the first memory region. For example, whenthe second data are written, the data comparison write circuit 450 maycompare the first data stored in the first memory region and the seconddata stored in the data buffer. The write circuit 440 may write thesecond data based on a comparison result (i.e., the enable signal EN).

FIG. 9 illustrates an example of a command and an address provided to amemory device of FIG. 7 for a data swap. FIGS. 10A to 10D illustrate anexample of an operation in which a memory device of FIG. 7 swaps databased on a command and an address of FIG. 9. Below, an operation inwhich a memory device of FIG. 7 swaps data stored in one bank will bedescribed with reference to FIGS. 9 to 10D. The command CMD and theaddress ADDR of FIG. 9 may be provided from a memory controller for thepurpose of swapping the first data DATA1 and the second data DATA2stored in a first bank 411.

Referring to FIGS. 9 and 10A, at a first time t1, the active command ACTand an address A1 may be provided. The address A1 may indicate the firstmemory region MA1 of the first bank 411. In response to the activecommand ACT and the address A1, the read circuit 430 may read the firstdata DATA1 from the first memory region MA1. The first data DATA1 thusread may be output to the selection circuit 470. The selection circuit470 may select the first data DATA1 output from the read circuit 430 andmay store the first data DATA1 in a first data buffer 481 ({circlearound (1)}). The first data buffer 481 may correspond to the first bank411.

Referring to FIGS. 9 and 10B, after the active command ACT is providedand a delay time tRCD elapses, that is, at a second time t2, a writecommand WC1 and an address A2 may be provided. The address A2 mayindicate the second memory region MA2 of the first bank 411. In responseto the write command WC1 and the address A2, the read circuit 430 mayread the second data DATA2 stored in the second memory region MA2 andmay provide the second data DATA2 to the data comparison write circuit450. The first data DATA1 stored in the first data buffer 481 may beprovided to the data comparison write circuit 450. The data comparisonwrite circuit 450 may perform an XOR operation on the first data DATA1provided from the first data buffer 481 and the second data DATA2 readfrom the second memory region MA2 and may store a first operation resultORD1 as a result of the XOR operation ({circle around (2)}). The writecircuit 440 may write the first data DATA1 stored in the first databuffer 481 in the second memory region MA2 ({circle around (3)}). Forexample, the write circuit 440 may write the first data DATA1 in thesecond memory region MA2 based on the first operation result ORD1.

Referring to FIGS. 9 and 10C, after the write command WC1 is providedand a data recovery time tWR elapses, that is, at a third time t3, aswap active command SACT and an address A3 may be provided. The addressA3 may indicate the second memory region MA2 of the first bank 411. Inresponse to the swap active command SACT and the address A3, the readcircuit 430 may read the first data DATA1 stored in the second memoryregion MA2 and may provide the first data DATA1 to the XOR gate 460. TheXOR gate 460 may perform an XOR operation on the first operation resultORD1 and the first data DATA1 to generate the second data DATA2 ({circlearound (4)}). The selection circuit 470 may output the second data DATA2output from the XOR gate 460 to the data buffer block 480. As such, thesecond data DATA2 may be stored in the first data buffer 481 ({circlearound (5)}).

Here, the swap active command SACT may be a command different from theactive command ACT. The control logic 490 of FIG. 7 may control theselection circuit 470 in response to the active command ACT such thatdata output from the read circuit 430 are stored in the data bufferblock 480. In contrast, the control logic 490 may control the selectioncircuit 470 in response to the swap active command SACT such that dataoutput from the XOR gate 460 are stored in the data buffer block 480.For example, the active command ACT and the swap active command SACT maybe identified based on a separate flag bit.

Referring to FIGS. 9 and 10D, after the swap active command SACT isprovided and the delay time tRCD elapses, that is, at a fourth time t4,a write command WC2 and an address A4 may be provided. The address A4may indicate the first memory region MA1 of the first bank 411. Inresponse to the write command WC2 and the address A4, the read circuit430 may read the first data DATA1 stored in the first memory region MA1and may provide the first data DATA1 to the data comparison writecircuit 450. The second data DATA2 stored in the first data buffer 481may be provided to the data comparison write circuit 450. The datacomparison write circuit 450 may perform an XOR operation on the firstdata DATA1 read from the first memory region MA1 and the second dataDATA2 provided from the first data buffer 481 and may store a secondoperation result ORD2 as a result of the XOR operation ({circle around(6)}). The write circuit 440 may write the second data DATA2 stored inthe first data buffer 481 in the first memory region MA1 ({circle around(7)}). For example, the write circuit 440 may write the second dataDATA2 in the first memory region MA1 based on the second operationresult ORD2.

FIG. 11 illustrates another example of an operation in which a memorydevice of FIG. 7 swaps data based on a command and an address of FIG. 9.Below, an operation in which a memory device of FIG. 7 swaps data storedin different banks will be described with reference to FIGS. 9 to 11.

Referring to FIGS. 9 and 11, the command CMD and the address ADDR ofFIG. 9 may be provided from a memory controller for the purpose ofswapping the first data DATA1 and the second data DATA2 stored in thefirst bank 411 and the second bank 412. The data buffer block 480 mayinclude the first data buffer 481 and the second data buffer 482. Thefirst data buffer 481 may correspond to the first bank 411, and thesecond data buffer 482 may correspond to the second bank 412.

At the first time t1, the active command ACT and the address A1 may beprovided. The address A1 may indicate the first memory region MA1 of thefirst bank 411. In response to the active command ACT and the addressA1, the read circuit 430 may read the first data DATA1 from the firstmemory region MA1. The first data DATA1 thus read may be stored in thefirst data buffer 481 ({circle around (1)}).

After the active command ACT is provided and the delay time tRCDelapses, that is, at the second time t2, the write command WC1 and theaddress A2 may be provided. The address A2 may indicate the secondmemory region MA2 of the second bank 412. In response to the writecommand WC1 and the address A2, the data comparison write circuit 450may perform an XOR operation on the first data DATA1 provided from thefirst data buffer 481 and the second data DATA2 read from the secondmemory region MA2 and may store an operation result ORD as a result ofthe XOR operation ({circle around (2)}). The write circuit 440 may writethe first data DATA1 stored in the first data buffer 481 in the secondmemory region MA2 ({circle around (3)}). As such, the second data DATA2stored in the second memory region MA2 may be replaced with the firstdata DATA1. In this case, the first data DATA1 stored in the first databuffer 481 may be transferred to the second data buffer 482, and thefirst data DATA1 may be provided to the write circuit 440 from thesecond data buffer 482.

After the write command WC1 is provided and the data recovery time tWRelapses, that is, at the third time t3, the swap active command SACT andthe address A3 may be provided. The address A3 may indicate the secondmemory region MA2 of the second bank 412. In response to the swap activecommand SACT and the address A3, the read circuit 430 may read the firstdata DATA1 stored in the second memory region MA2 and may provide thefirst data DATA1 to the XOR gate 460. The XOR gate 460 may perform anXOR operation on the operation result ORD and the first data DATA1 togenerate the second data DATA2 ({circle around (4)}). The selectioncircuit 470 may select the second data DATA2 output from the XOR gate460 and may output the second data DATA2 to the data buffer block 480.The second data DATA2 may be stored in the second data buffer 482corresponding to the second bank 412 ({circle around (5)}).

After the swap active command SACT is provided and the delay time tRCDelapses, that is, at the fourth time t4, the write command WC2 and theaddress A4 may be provided. The address A4 may indicate the first memoryregion MA1 of the first bank 411. In response to the write command WC2and the address A4, the write circuit 440 may write the second dataDATA2 stored in the second data buffer 482 in the first memory regionMA1 ({circle around (6)}). As such, the first data DATA1 stored in thefirst memory region MA1 may be replaced with the second data DATA2. Inthis case, the second data DATA2 stored in the second data buffer 482may be transferred to the first data buffer 481, and the second dataDATA2 may be provided to the write circuit 440 from the first databuffer 481.

An example is illustrated in FIG. 9 that the address ADDR is providedseparately from the command CMD when the active command ACT and/or thewrite command WC are provided, but the disclosure is not limitedthereto. For example, the active command ACT and/or the write command WCmay include information about a row address and the address ADDRcorresponding to the active command ACT and/or the write command WC mayinclude information about a bank address and a column address.

As described above, the memory device 400 may perform the operations ofFIG. 8 in response to the active command ACT, the write command WC, andthe swap active command SACT. However, the disclosure is not limitedthereto. For example, the memory device 400 may perform the operationsof FIG. 8 in response to one swap command SWAP.

Below, another example of an operation in which the memory device 400 ofFIG. 7 swaps data will be described in detail with reference to FIGS. 12and 13. In detail, an operation in which data stored in different banksare swapped will be described with reference to FIGS. 12 and 13.

FIG. 12 illustrates an example of a command and an address provided to amemory device of FIG. 7 for a swap of data stored in different banks.FIG. 13 illustrates an example of an operation in which a memory deviceof FIG. 7 swaps data based on a command and an address of FIG. 12.

Referring to FIGS. 12 and 13, the command CMD and the address ADDR ofFIG. 12 may be provided from a memory controller for the purpose ofswapping the first data DATA1 stored in the first bank 411 with thesecond data DATA2 stored in the second bank 412.

At the first time t1, an active command ACT1 and the address A1 may beprovided. The address A1 may indicate the first memory region MA1 of thefirst bank 411. In response to the active command ACT1 and the addressA1, the read circuit 430 may read the first data DATA1 from the firstmemory region MA1. The first data DATA1 thus read may be stored in thefirst data buffer 481 through the selection circuit 470 ({circle around(1)}).

After the active command ACT1 is provided and a delay time tCCD elapses,that is, at the second time t2, an active command ACT2 and the addressA2 may be provided. The address A2 may indicate the second memory regionMA2 of the second bank 412. In response to the active command ACT2 andthe address A2, the read circuit 430 may read the second data DATA2 fromthe second memory region MA2. The second data DATA2 thus read may bestored in the second data buffer 482 through the selection circuit 470({circle around (2)}).

After the active command ACT1 is provided and the delay time tRCDelapses, that is, at the third time t3, the write command WC1 and theaddress A3 may be provided. The address A3 may indicate the first memoryregion MA1 of the first bank 411. In response to the write command WC1and the address A3, the write circuit 440 may write the second dataDATA2 stored in the second data buffer 482 in the first memory regionMA1 ({circle around (3)}). As such, the first data DATA1 stored in thefirst memory region MA1 may be replaced with the second data DATA2. Inthis case, the second data DATA2 stored in the second data buffer 482may be transferred to the first data buffer 481, and the second dataDATA2 may be provided to the write circuit 440 from the first databuffer 481. In an exemplary embodiment, as described with reference toFIG. 7, the second data DATA2 may be written based on a comparisonresult of the data comparison write circuit 450 obtained with regard tothe first data DATA1 and the second data DATA2.

After the write command WC1 is provided and a delay time tWC2WC elapses,that is, at the fourth time t4, the write command WC2 and the address A4may be provided. The address A4 may indicate the second memory regionMA2 of the second bank 412. In response to the write command WC2 and theaddress A4, the write circuit 440 may write the first data DATA1 storedin the first data buffer 481 in the second memory region MA2 ({circlearound (4)}). As such, the second data DATA2 stored in the second memoryregion MA2 may be replaced with the first data DATA1. In this case, thefirst data DATA1 stored in the first data buffer 481 may be transferredto the second data buffer 482, and the first data DATA1 may be providedto the write circuit 440 from the second data buffer 482. In anexemplary embodiment, as described with reference to FIG. 7, the firstdata DATA1 may be written based on a comparison result of the datacomparison write circuit 450 obtained with regard to the first dataDATA1 and the second data DATA2.

As described above, in the case of swapping data stored in differentbanks, as described with reference to FIGS. 9 and 11, the memory device400 may swap data by using the active command ACT and the swap activecommand SACT. In this case, the memory device 400 may control theselection circuit 470 such that data are swapped based on data generatedthrough the data comparison write circuit 450 and the XOR gate 460.Alternatively, in the case of swapping data stored in different banks,as described with reference to FIGS. 12 and 13, the memory device 400may swap data by using the active command ACT, without the swap activecommand SACT. In this case, the memory device 400 may control theselection circuit 470 such that data are swapped without using datagenerated through the data comparison write circuit 450 and the XOR gate460. According to the data swap operation described with reference toFIGS. 12 and 13, in the case of swapping data stored in different banks,data may be swapped more quickly than in the case of the data swapoperation described with reference to FIGS. 9 and 11.

As described above, the memory device 400 according to an exemplaryembodiment of the disclosure may generate data, which are the same asdata (e.g., the second data DATA2) to be swapped, by using the datacomparison write (DCW) circuit 450 and the XOR gate 460. In this case,the data to be swapped may be understood as being temporarily stored (orbuffered or latched) by the data comparison write circuit 450 and theXOR gate 460 before the data to be swapped are stored in the data bufferblock 480.

As such, the memory device 400 may generate or temporarily store data(e.g., the second data DATA2) to be swapped by using separate datageneration logic such as the data comparison write circuit 450 and theXOR gate 460. As illustrated in FIGS. 7 to 13, the memory device 400 mayinclude the data comparison write circuit 450 and the XOR gate 460 asthe data generation logic, but the disclosure is not limited thereto.For example, the memory device 400 may be implemented with any logic (orblock or circuit) capable of generating data to be swapped ortemporarily storing data to be swapped.

FIG. 14 illustrates a block diagram of a memory system according to anexemplary embodiment of the disclosure. Referring to FIG. 14, a memorysystem 2000 may include a memory controller 20 and a memory device 500.The memory device 500 may include a memory cell array 510, a data bufferblock 520, and an error detection circuit 530. An operation of thememory device 500 is similar to the operation of the memory device 400of FIG. 7, and thus, additional description will be omitted to avoidredundancy. That is, the memory device 500 may further includecomponents such as a data comparison write circuit, but the componentsare omitted in FIG. 14 for convenience of description.

The memory device 500 may swap the first data DATA1 stored in the firstmemory region MA1 with the second data DATA2 stored in the second memoryregion MA2. The memory device 500 may swap data by using the data bufferblock 520 as described with reference to FIGS. 7 to 13. In the swapprocess, the data buffer block 520 may store the first data DATA1 andthe second data DATA2.

Before written in the memory cell array 510, the first data DATA1 andthe second data DATA2 stored in the data buffer block 520 may beprovided to the error detection circuit 530. The error detection circuit530 may detect an error of the first data DATA1 and the second dataDATA2. For example, the error detection circuit 530 may check parity todetect an error.

When an error is detected, the memory device 500 may provide an errordetection signal ALERT to the memory controller 20. In response to theerror detection signal ALERT, the memory controller 20 may provideerror-corrected data ECDAT to the memory device 500. For example, whenan error is detected from the first data DATA1, the memory controller 20may provide error-corrected first data to the memory device 500.

The error-corrected data ECDAT may be stored in the data buffer block520. In this case, data of the data buffer block 520 may be replacedwith the error-corrected data ECDAT. As such, the error-corrected dataECDAT of the data buffer block 520 may be written in the memory cellarray 510. For example, when an error is detected from the first dataDATA1 stored in the first memory region MA1, first data that areerror-corrected in a swap process may be written in the second memoryregion MA2.

An example is illustrated in FIG. 14 that, in the data swap process, thememory device 500 detects an error of data and receives theerror-corrected data ECDAT from the memory controller 20, but thedisclosure is not limited thereto. For example, the memory device 500may detect and directly correct an error of data in the data swapprocess. In this case, the memory device 500 may not provide the errordetection signal ALERT to the memory controller 20. That is, the memorydevice 500 may directly correct an error of data and may perform theswap operation based on error-corrected data.

FIG. 15 illustrates a block diagram of a memory system according to anexemplary embodiment of the disclosure. Referring to FIG. 15, a memorysystem 3000 may include a memory controller 30 and a memory device 600.The memory device 600 may include a memory cell array 610, a data bufferblock 620, a swap buffer block 630, and an error detection circuit 640.An operation of the memory device 600 is similar to the operation of thememory device 200 of FIG. 2, and thus, additional description will beomitted to avoid redundancy. That is, the memory device 600 may furtherinclude components such as a data comparison write circuit, but thecomponents are omitted in FIG. 15 for convenience of description.

The memory device 600 may swap the first data DATA1 stored in the firstmemory region MA1 with the second data DATA2 stored in the second memoryregion MA2. The memory device 600 may swap data by using the data bufferblock 620 and the swap buffer block 630 as described with reference toFIGS. 2 to 5. In the swap process, the data buffer block 620 may storethe first data DATA1, and the swap buffer block 630 may store the seconddata DATA2.

Before written in the memory cell array 610, the first data DATA1 storedin the data buffer block 620 and the second data DATA2 stored in theswap buffer block 630 may be provided to the error detection circuit640. The error detection circuit 640 may detect an error of the firstdata DATA1 and the second data DATA2. For example, the error detectioncircuit 640 may check parity to detect an error.

When an error is detected, the memory device 600 may provide the errordetection signal ALERT to the memory controller 30. In response to theerror detection signal ALERT, the memory controller 30 may provide theerror-corrected data ECDAT to the memory device 600. For example, whenan error is detected from the first data DATA1, the memory controller 30may provide error-corrected first data to the memory device 600.

The error-corrected data ECDAT may be stored in the data buffer block620 or the swap buffer block 630. For example, error-corrected firstdata may be stored in the data buffer block 620 and error-correctedsecond data may be stored in the swap buffer block 630. In this case,data of the data buffer block 620 or the swap buffer block 630 may bereplaced with the error-corrected data ECDAT. As such, theerror-corrected data ECDAT may be written in the memory cell array 610.

An example is illustrated in FIG. 15 that, in the data swap process, thememory device 600 detects an error of data and receives theerror-corrected data ECDAT from the memory controller 30, but thedisclosure is not limited thereto. For example, the memory device 600may detect and directly correct an error of data in the data swapprocess. In this case, the memory device 600 may not provide the errordetection signal ALERT to the memory controller 30. That is, the memorydevice 600 may directly correct an error of data and may perform theswap operation based on error-corrected data.

As described above, according to an exemplary embodiment of thedisclosure, an error of data may be corrected in the data swap process.Accordingly, the reliability of data that are stored in the data swapprocess may be improved.

FIG. 16 is a block diagram of a computing device according to anexemplary embodiment of the disclosure. Referring to FIG. 16, acomputing device 4000 may include a processor 4100, a memory controller4200, a main memory 4300, a system interconnect 4400, a storage device4500, a user interface 4600, and a modem 4700. The computing device 4000may be implemented with one of various computing devices such as adesktop computer, a notebook computer, a data server, an applicationserver, a smartphone, and a smart tablet.

The processor 4100 may be a central processing unit (CPU) or anapplication processor (AP) that performs various operations. Theprocessor 4100 controls the respective components of the computingdevice 4000 so as to perform a write operation, a read operation, or anyother operation. For example, the processor 4100 may access the mainmemory 4300 by using the memory controller 4200.

The memory controller 4200 may allow the main memory 4300 to perform awrite operation or a read operation under control of the processor 4100.For example, the memory controller 4200 may allow the main memory 4300to perform a write operation on data signals DQ.

In an embodiment, the memory controller 4200 may include the functionsof the memory controllers 10 to 30 described with reference to FIGS. 1to 15. For example, the memory controller 4200 may provide the commandCMD for swap and the address ADDR data to the main memory 4300.

The main memory 4300 may receive the address ADDR and the command CMDfrom the memory controller 4200. The main memory 4300 may exchange thedata signals DQ with the memory controller 4200. The main memory 4300may include a volatile memory, such as a static RAM (SRAM), a dynamicRAM (DRAM), or a synchronous DRAM (SDRAM), or a nonvolatile memory, suchas a read only memory (ROM), a programmable ROM (PROM), an electricallyprogrammable ROM (EPROM), an electrically erasable and programmable ROM(EEPROM), a flash memory, a phase-change RAM (PRAM), a magnetic RAM(MRAM), a resistive RAM (RRAM), or a ferroelectric RAM (FRAM).

In an embodiment, the main memory 4300 may include one of the memorydevices 100 to 600 described with reference to FIGS. 1 to 15. Forexample, the main memory 4300 may swap data in response to the commandCMD for swap and the address ADDR. The main memory 4300 may swap datainternally without using the memory controller 4200. Accordingly, a dataswap speed may be improved, and the communication overhead between thememory device 4200 and the memory controller 4300 due to the data swapmay decrease.

The system interconnect 4400 may provide channels between the componentsof the computing device 4000. The system interconnect 4400 may beimplemented in compliance with one of various standards such asperipheral component interconnect express (PCIe) and advancedmicrocontroller bus architecture (AMBA).

The storage device 4500 may function as a secondary memory of thecomputing device 4000. The storage device 4500 may have an access speedslower than the main memory 4300 and may have a storage capacity largerthan the main memory 4300. The storage device 4500 may include a harddisk drive (HDD), a solid-state drive (SSD), a portable memory, etc.

The user interface 4600 may exchange information with a user. The userinterface 2400 may include a user input interface, which receivesinformation from the user, such as a keyboard, a mouse, a touch panel,or a microphone, and a user output interface, which provides informationto the user, such as a monitor, a speaker, or a motor.

The modem 4700 is configured to perform wired or wireless communicationwith an external device. The modem 4700 may be configured to implementat least one of various standards such as long-term evolution (LTE),Ethernet, wireless-fidelity (Wi-Fi), and Bluetooth. In an exemplaryembodiment, the modem 4700 may be included within the processor 4100.

A memory device according to the disclosure may swap data stored in onebank or different banks without using a memory controller. Accordingly,a data swap may be quickly performed, and the communication overheadbetween the memory device and the memory controller may decrease.

Also, the memory device according to an exemplary embodiment of thedisclosure may swap data by using an internal data comparison writecircuit without using the memory controller. As such, a data swapoperation may be performed within the memory device without adding aseparate buffer for swap.

As is traditional in the field, embodiments may be described andillustrated in terms of blocks which carry out a described function orfunctions. These blocks, which may be referred to herein as units ormodules or the like, are physically implemented by analog and/or digitalcircuits such as logic gates, integrated circuits, microprocessors,microcontrollers, memory circuits, passive electronic components, activeelectronic components, optical components, hardwired circuits and thelike, and may optionally be driven by firmware and/or software. Thecircuits may, for example, be embodied in one or more semiconductorchips, or on substrate supports such as printed circuit boards and thelike. The circuits constituting a block may be implemented by dedicatedhardware, or by a processor (e.g., one or more programmedmicroprocessors and associated circuitry), or by a combination ofdedicated hardware to perform some functions of the block and aprocessor to perform other functions of the block. Each block of theembodiments may be physically separated into two or more interacting anddiscrete blocks without departing from the scope of the disclosure.Likewise, the blocks of the embodiments may be physically combined intomore complex blocks without departing from the scope of the disclosure.An aspect of an embodiment may be achieved through instructions storedwithin a non-transitory storage medium and executed by a processor.

While the disclosure has been described with reference to exemplaryembodiments thereof, it will be apparent to those of ordinary skill inthe art that various changes and modifications may be made theretowithout departing from the spirit and scope of the disclosure as setforth in the following claims.

1. An operating method of a memory device, which includes a first memoryregion and a second memory region, the method comprising: reading firstdata from the first memory region and storing the read first data in adata buffer; performing a first XOR operation on the first data providedfrom the data buffer and second data read from the second memory regionto generate first result data; writing the first data stored in the databuffer in the second memory region; performing a second XOR operation onthe first data and the first result data to obtain generated seconddata; storing the generated second data in the data buffer; and writingthe second data, stored in the data buffer, into the first memoryregion.
 2. The method of claim 1, wherein the first memory region andthe second memory region are included in one bank.
 3. The method ofclaim 2, wherein: the read first data and the generated second data arestored in a first data buffer of the data buffer, and the first databuffer corresponds to the bank.
 4. The method of claim 1, wherein thefirst memory region is included in a first bank and the second memoryregion is included in a second bank.
 5. The method of claim 4, wherein:the read first data are stored in a first data buffer of the data bufferand the generated second data are stored in a second data buffer of thedata buffer, and the first data buffer corresponds to the first bank andthe second data buffer corresponds to the second bank.
 6. The method ofclaim 5, wherein the writing of the first data stored in the data bufferin the second memory region includes: transferring the first data storedin the first data buffer to the second data buffer; and writing thefirst data transferred to the second data buffer in the second memoryregion.
 7. The method of claim 1, wherein the writing of the first data,stored in the data buffer, into the second memory region includes:maintaining the second data of the second memory region when the firstresult data indicates that the first data of the data buffer areidentical to the second data of the second memory region; and replacingthe second data of the second memory region with the first data when thefirst result data indicates that the first data of the data buffer aredifferent from the second data of the second memory region.
 8. Themethod of claim 1, wherein error-corrected first data are written in thesecond memory region when an error is detected from the first datastored in the data buffer.
 9. The method of claim 1, wherein the memorydevice is a phase-change memory (PRAM).
 10. A memory device comprising:a memory cell array including a first memory region storing first dataand a second memory region storing second data; a read circuitconfigured to read the first data from the first memory region; a datageneration circuit configured to generate third data identical to thesecond data based on the second data from the second memory region; aselection circuit configured to output one of the first data from theread circuit and the third data from the data generation circuit basedon a control signal; a data buffer configured to store the first data orthe third data that is output from the selection circuit; and a writecircuit configured to write the first data of the data buffer in thesecond memory region and to write the third data of the data buffer inthe first memory region.
 11. The memory device of claim 10, wherein: thecontrol signal includes a first control signal and a second controlsignal which are generated in a process of swapping the first data andthe second data, and the selection circuit outputs the first data basedon the first control signal and outputs the third data based on thesecond control signal.
 12. The memory device of claim 10, wherein thedata generation circuit includes: a data comparison write circuitconfigured to perform a first XOR operation on the first data and thesecond data to output result data; and an XOR gate configured to performa second XOR operation on the result data of the data comparison writecircuit and the first data to generate the third data.
 13. The memorydevice of claim 10, wherein: the first memory region and the secondmemory region are included in one bank, and a first data buffer of thedata buffer corresponding to the bank stores the first data and thethird data.
 14. The memory device of claim 10, wherein: the first memoryregion is included in a first bank, and the second memory region isincluded in a second bank, and a first data buffer of the data buffercorresponding to the first bank stores the first data, and a second databuffer of the data buffer corresponding to the second bank stores thethird data.
 15. An operating method of a memory device, which includes afirst memory region and a second memory region, the method comprising:reading first data from the first memory region and storing the readfirst data in a data buffer; reading second data from the second memoryregion and storing the read second data in a swap buffer; writing thefirst data stored in the data buffer in the second memory region; andwriting the second data stored in the swap buffer in the first memoryregion.
 16. The method of claim 15, wherein: the first memory region andthe second memory region are included in one bank, and the data bufferand the swap buffer correspond to the bank.
 17. The method of claim 15,wherein: the first memory region is included in a first bank, and thesecond memory region is included in a second bank, and the data buffercorresponds to the first bank, and the swap buffer corresponds to thesecond bank.
 18. The method of claim 15, wherein: error-corrected firstdata are written in the second memory region when an error is detectedfrom the first data stored in the data buffer, and error-correctedsecond data are written in the first memory region when an error isdetected from the second data stored in the swap buffer.
 19. The methodof claim 15, wherein: the memory device further includes: a memory cellarray including the first memory region and the second memory region;and a data comparison write circuit configured to compare data read fromthe memory cell array and data provided from the data buffer to generatea comparison result, and the swap buffer is included in the datacomparison write circuit.
 20. The method of claim 19, wherein the readsecond data are stored in the swap buffer in a swap operation of thememory device and the comparison result is stored in the swap buffer ina write operation of the memory device. 21-29. (canceled)